package com.guochenglang.www.pojo;

import com.guochenglang.www.pojo.annotate.Table;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * 文章表
 *
 * @author 郭程朗
 */
@Table("article")
public class Article {
    /**
     * 主键
     */
    private Integer id;
    /**
     * 标题
     */
    private String title;
    /**
     * 内容
     */
    private String content;
    /**
     * 创建者id
     */
    private Integer createrId;
    /**
     * 创建时间
     */
    private Timestamp creatTime;
    /**
     * 隶属知识库id
     */
    private Integer baseId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Article article = (Article) o;
        return Objects.equals(id, article.id) && Objects.equals(title, article.title) && Objects.equals(content, article.content) && Objects.equals(createrId, article.createrId) && Objects.equals(creatTime, article.creatTime) && Objects.equals(baseId, article.baseId);
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", createrId=" + createrId +
                ", creatTime=" + creatTime +
                ", baseId=" + baseId +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, title, content, createrId, creatTime, baseId);
    }

    public Article(Integer id, Integer baseId, Timestamp creatTime, Integer createrId, String title, String content) {
        this.id = id;
        this.baseId = baseId;
        this.creatTime = creatTime;
        this.createrId = createrId;
        this.title = title;
        this.content = content;
    }

    public Article() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBaseId() {
        return baseId;
    }

    public void setBaseId(Integer baseId) {
        this.baseId = baseId;
    }

    public Timestamp getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Timestamp creatTime) {
        this.creatTime = creatTime;
    }

    public Integer getCreaterId() {
        return createrId;
    }

    public void setCreaterId(Integer createrId) {
        this.createrId = createrId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        return content;
    }

    public void setText(String text) {
        this.content = text;
    }
}
